
import engine.Edge;
import engine.Node;
import java.awt.Color;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

/**
 *
 * @author Johnny
 */
public class EdgeTester {

    public EdgeTester() {
    }

    @BeforeClass
    public static void setUpClass() throws Exception {
    }

    @AfterClass
    public static void tearDownClass() throws Exception {
    }

    @Before
    public void setUp() {
    }

    @After
    public void tearDown() {
    }

    @Test
    public void test1() {
        Node a = new Node(1, 1, 1, "");
        Node b = new Node(2, 7, 4, "");
        Edge e = new Edge(1, Color.yellow, a, b);

        /*
        e.addMiddleNode(new Node(3, 2, 5, null));
        e.addMiddleNode(new Node(4, 4, 3, null));
        e.recalcCdp();

        Node c;
        for (float i = 0; i <= 100; i+=10) {
            c = e.getAbstractPos(i);
            System.out.println(c.getX() + " " + c.getY());
        }

        System.out.println();
        CdpData[] cdp = e.getCdp();
        for (CdpData cd : cdp) {
            System.out.println(cd.getNode().getX() + " " + cd.getNode().getY() +
                    " " + cd.getPerc());
        }
         
        System.out.println();
        e.removeMiddleNode(4);
        e.recalcCdp();

        for (float i = 0; i <= 100; i+=0.9) {
            c = e.getAbstractPos(i);
            System.out.println(c.getX() + " " + c.getY());
        }

        System.out.println();
        cdp = e.getCdp();
        for (CdpData cd : cdp) {
            System.out.println(cd.getNode().getX() + " " + cd.getNode().getY() +
                    " " + cd.getPerc());
        }
 */

        System.out.println();
        System.out.println(e);
    }
}
